#include<iostream>
#include<queue>
using namespace std;

int main()
{
    long long n = 0, k = 0, sum = 0, x = 0;
    cin >> n >> k;
    priority_queue<long long> heap;
    while(n--)
    {
        cin >> x;
        sum += x;
        if(x%2 == 0)
            heap.push(x);
    }

    while(!heap.empty() && k--)
    {
        long long t = heap.top()/2;
        sum -= t;
        heap.pop();
        if(t%2 == 0)
            heap.push(t);
    }
    cout << sum << endl;
    return 0;
}